<?php

function my_countryinfo ($atts) {
    extract (
	shortcode_atts (
	    array (
		"lang" => "de",
		"country" => "DE",
	    ),
	    $atts
	)
    );
    $output = "";
    $result = wp_remote_get ("http://ws.geonames.org/countryInfo?lang=" . $lang . "&country=" . $country);
    if (!is_wp_error ($result)) {
	// $result['body'] contains the requested content
	$output = $result["body"];
    }
    return $output;
}
add_shortcode ("countryinfo", "my_countryinfo");

?>
